<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.*,com.java.entity.*" %>   
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<table border="1" cellspacing="0">
		<tr>
			<td>编号</td>
			<td>用户名</td>
			<td>密码</td>
			<td>邮箱</td>
			<td>地址</td>
			<td>查看</td>
		</tr>
		<%
	      		
		List<User> list = (List<User>) request.getAttribute("users");
		int xh=0;
		for (int i = 0; i < list.size(); i++) {
			User u = list.get(i);
			xh=i+1;
	%>
	<%
	   if(xh%2==1){
		  %>
		   <tr style="background-color:greenyellow;">
			<td><%=xh %></td>
			<td><%=u.getName() %></td>
			<td><%=u.getPwd() %></td>
			<td><%=u.getEmail() %></td>
			<td><%=u.getAddress() %></td>
			<td><a href="#">详情</a></td>
		</tr>
	 <%  }else{
	%>
	<tr>
		<td><%=xh %></td>
		<td><%=u.getName() %></td>
		<td><%=u.getPwd() %></td>
		<td><%=u.getEmail() %></td>
		<td><%=u.getAddress() %></td>
		<td><a href="#">详情</a></td>
	</tr>
	<%
	 }
		}
	%>

	</table>
</body>
</html>